﻿using System;
using System.Collections.Generic;
using System.Reflection;

namespace SaaS.Core.Authorization
{
    public static class PermissionNames
    {
        /// <summary>
        /// 获取所有权限
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<string> GetPermissions()
        {
            Type obj = typeof(PermissionNames);
            foreach (var field in obj.GetFields())
            {
                yield return field.GetValue(obj).ToString();
            }
        }
        #region 权限管理
        /// <summary>
        /// 权限管理
        /// </summary>
        public const string Permission = "Permission";
        #region 用户管理
        public const string Permission_User = "Permission.User";
        public const string User_Create = "Permission.User.Create";
        public const string User_Edit = "Permission.User.Edit";
        public const string User_Delete = "Permission.User.Delete";
        public const string User_Authoriza = "Permission.User.Authoriza";
        #endregion

        #region 角色管理
        public const string Permission_Role = "Permission.Role";
        public const string Permission_Role_Create = "Permission.Role.Create";
        public const string Permission_Role_Edit = "Permission.Role.Edit";
        public const string Permission_Role_Delete = "Permission.Role.Delete";
        public const string Permission_Role_Authoriza = "Permission.Role.Authoriza";
        #endregion

        #region 机构管理
        public const string Permission_OrganizationUnit = "Permission.OrganizationUnit";
        public const string OrganizationUnit_Create = "Permission.OrganizationUnit.Create";
        public const string OrganizationUnit_Edit = "Permission.OrganizationUnit.Edit";
        public const string OrganizationUnit_Query = "Permission.OrganizationUnit.Query";
        public const string OrganizationUnit_Delete = "Permission.OrganizationUnit.Delete";
        #endregion

        #region 菜单管理
        public const string Permission_Menu = "Permission.Menu";
        public const string Menu_Create = "Permission.Menu.Create";
        public const string Menu_Edit = "Permission.Menu.Edti";
        public const string Menu_Delete = "Permission.Menu.Delete";
        public const string Menu_Query = "Permission.Menu.Query";
        public const string Menu_Authoriza = "Permission.Menu.Authoriza";
        #endregion

        #endregion

        #region 平台管理
        public const string Site = "Site";
        /// <summary>
        /// 客户管理
        /// </summary>
        public const string Site_Tenant = "Site.Tenant";
        public const string Site_Tenant_Query = "Site.Tenant.Query";
        public const string Site_Tenant_Login = "Site.Tenant.Login";//登录客户后台
        public const string Site_Tenant_ResetPwd = "Site.Tenant.ResetPwd";//重置密码
        /// <summary>
        /// 运营平台
        /// </summary>
        public const string Site_Operation = "Site.Operation";
        public const string Site_Order = "Site.Order";
        public const string Site_Order_Query = "Site.Order.Query";


        /// <summary>
        /// 产品列表
        /// </summary>
        public const string Site_Project = "Site.Project";
        public const string Site_Project_Create = "Site.Project.Create";
        public const string Site_Project_Edit = "Site.Project.Edit";
        public const string Site_Project_Delete = "Site.Project.Delete";
        public const string Site_Project_Query = "Site.Project.Query";
        public const string Site_Project_Release = "Site.Project.Release";//发布产品
        public const string Site_Project_Authoriza = "Site.Project.Authoriza";//产品授权

        #endregion


        #region 门户管理

        public const string Gateway = "Gateway";
        /// <summary>
        /// 基础设置
        /// </summary>
        public const string Gateway_Basics = "Gateway.Basics";
        public const string Gateway_Basics_Create = "Gateway.Basics.Create";
        public const string Gateway_Basics_Edit = "Gateway.Basics.Edti";
        public const string Gateway_Basics_Delete = "Gateway.Basics.Delete";
        public const string Gateway_Basics_Query = "Gateway.Basics.Query";

        /// <summary>
        /// 新闻公告
        /// </summary>
        public const string Gateway_Notice = "Gateway.Notice";
        public const string Gateway_Notice_Create = "Gateway.Notice.Create";
        public const string Gateway_Notice_Edit = "Gateway.Notice.Edit";
        public const string Gateway_Notice_Delete = "Gateway.Notice.Delete";
        public const string Gateway_Notice_Query = "Gateway.Notice.Query";
        #endregion

        #region 日志管理
        public const string Log = "Log";
        /// <summary>
        /// 登录日志
        /// </summary>
        public const string Log_Login = "Log.Login";
        /// <summary>
        /// 网关日志
        /// </summary>
        public const string Log_Gateway = "Log.Gateway";
        /// <summary>
        /// 审计日志
        /// </summary>
        public const string Log_System = "Log.AuditLog";
        /// <summary>
        /// 文件日志
        /// </summary>
        public const string Log_File = "Log.File";
        /// <summary>
        /// 博客日志
        /// </summary>
        public const string Log_Blog = "Log.Blog";
        /// <summary>
        /// 错误日志
        /// </summary>
        public const string Log_Error = "Log.Error";
        /// <summary>
        /// 跟踪日志
        /// </summary>
        public const string Log_Trace = "Log.Trace";
        /// <summary>
        /// 
        /// </summary>
        public const string Log_Scheduler = "Log.Scheduler";
        #endregion

        #region 系统管理
        public const string System = "System";
        /// <summary>
        /// 数据库管理
        /// </summary>
        public const string System_Database = "System.Database";

        #endregion

        #region 博客管理
        public const string Blog = "Blog";
        public const string Blog_Menu = "Blog.Menu";
        public const string Blog_Menu_Create = "Blog.Menu.Create";
        public const string Blog_Menu_Edit = "Blog.Menu.Edit";
        public const string Blog_Menu_Delete = "Blog.Menu.Delete";

        public const string Blog_Article = "Blog.Article";
        public const string Blog_Article_Create = "Blog.Article.Create";
        public const string Blog_Article_Edit = "Blog.Article.Edit";
        public const string Blog_Article_Delete = "Blog.Article.Delete";


        #endregion

    }
}
